package com.controller;

import com.domain.Appointment;
import com.domain.Depatrment;
import com.domain.Doctor;
import com.service.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 2024/5/27 医院管理系统接口实现
 */
@RestController
@RequestMapping("/hospital")
public class HospitalController {
  @Autowired
  private HospitalService hospitalService;

    //科室信息
    private ArrayList<Depatrment> depatrments=new ArrayList<>();

    //预约信息
    private  ArrayList<Appointment> appointments=new ArrayList<>();

   @GetMapping("/listDoctor")
   public List<Doctor> listDoctor(Doctor doctor){
      return hospitalService.listDoctor(doctor);
   }

    @PostMapping("/addDoctor")
    public List<Doctor> addDoctor(@RequestBody Doctor doctor){
        doctor.setDname("李丽华");
        doctor.setDepartmentName("妇产科");
        doctor.setGender("女");
        doctor.setAge(23);
        doctor.setSpecialty("手术");
        doctor.setJoinDate("2024-5-6");
        return hospitalService.insertDoctor(doctor);
    }
}
